package edu.uc.ui;

import android.app.Activity;
import android.view.Gravity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class CeasBaseScreen extends Activity {

	private static final int OK_MENU_ITEM = Menu.FIRST;
	private static final int BACK_MENU_ITEM = OK_MENU_ITEM + 1;
	

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
//		getMenuInflater().inflate(R.menu.ceas_base_screen, menu);
		menu.add(0, OK_MENU_ITEM, 0, "Ok");
		menu.add(0, BACK_MENU_ITEM, 0, "Back");
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case OK_MENU_ITEM:
			showMsg("Ok");
			break;
		case BACK_MENU_ITEM:
			showMsg("Back");
			break;
		}
		return super.onOptionsItemSelected(item);
	}
	
	private void showMsg(String msg) {
		Toast toast = Toast.makeText(CeasBaseScreen.this, msg, Toast.LENGTH_LONG);
		toast.setGravity(Gravity.CENTER, toast.getXOffset() / 2, toast.getYOffset() / 2);
		toast.show();
	}

}
